home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utmisc2 / datebkiv.lha / DateBookIV / Rexx / UpComing.rexx < prev   
OS/2 REXX Batch file  |  1996-02-25  |  1KB  |  70 lines

  1. /* File : upcoming.rexx
  2.  *
  3.  * $Project:           DateBookIV
  4.  *
  5.  * $Description:       Script to produce the same output as 
  6.  *                       DateBook mode=CLI, through the rexx
  7.  *                       port of a resident server.
  8.  *
  9.  * $Module Id:         
  10.  * $Original Author:   Robert Hardy
  11.  * $Date Started:      Thu Feb  1 1996
  12.  *
  13.  * $Header$
  14.  *
  15.  * $Revision$
  16.  *
  17.  * $State$
  18.  *
  19.  * $Locker$
  20.  *
  21.  * $Log$ 
  22.  *
  23.  *
  24.  */
  25.  
  26.  
  27.  
  28. OPTIONS RESULTS
  29.  
  30. port_name = 'datebook_rx'
  31. port_off = 0
  32.  
  33. if ~show('p', port_name) then do    /* Find out if DateBook is running */
  34.  
  35.     port_off = 1                    /* Set the flag for cleanup on exit */
  36.  
  37.     address command 'run datebook RXPORT 'port_name' MODE SERVER'
  38.     address command 'waitforport 'port_name        /* Wait till it's loaded */
  39.  
  40.     if ~show('p', port_name) then do        /* Find out if it ran */
  41.         say "Can't find Datebook??"
  42.         exit 5
  43.     end
  44. end
  45.  
  46. address VALUE port_name
  47.  
  48.     /* Ask Datebook for today's date */
  49. 'getfield $C'
  50. today = strip(translate(result, '', '"'))
  51.  
  52.     /* convert packed date to human readable form */
  53. EXPANDDATE today
  54. today = result
  55.  
  56.     /* ask for the report */
  57. 'UPCOMING UPDATE'
  58. if rc = 0 then do    /* only print if there is a report */
  59.     report = result
  60.  
  61.     say 'Upcoming On: 'today''
  62.     say
  63.     say report
  64. end
  65.  
  66. if port_off then 'shutdown'        /* If we started the server we should
  67.                                  * also close it.
  68.                                  */
  69. exit 0
  70.